﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using WebServer.Models;

namespace WebServer
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IArticle”。
    [ServiceContract]
    public interface IArticle
    {
        #region 分类逻辑

        /// <summary>
        /// 获取分类
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<NewsCate> Cate(int ID, bool IsDel);

        /// <summary>
        /// 获取存在交易所
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<NewsCate> CateGroup(int Parent, int CenterID);

        /// <summary>
        /// 获取单个分类
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        NewsCate CateByID(int ID);


        /// <summary>
        /// 创建分类
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="ParentID"></param>
        /// <returns></returns>
        [OperationContract]
        bool CateCreate(string Name, int ParentID);

        /// <summary>
        /// 更新分类-Name为空，Parent为-1则更新IsDel，否则更新 Name和 Parent（2个必须都传）
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        bool CateSet(int ID, string Name, int Parent, bool IsDel);

           /// <summary>
        /// 获取所有的子分类 
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<NewsCate> ManCate(bool IsDel);

         /// <summary>
        /// 获取判断是否有子节点的分类
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<NewsCate> CateList(int ID, bool IsDel);
        #endregion



        #region 文章处理

        /// <summary>
        /// 获取文章详情
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        Article ArticleByID(int ID);

        /// <summary>
        /// 文章排行获取-0:点击量;1:更新时间 
        /// </summary>
        /// <param name="CateID"></param>
        /// <param name="Size"></param>
        /// <param name="Sort">默认根据点击排序，1-修改时间</param>
        /// <returns></returns>
        [OperationContract]
        List<Article> ArticleBySort(int CateID, int Size, int Sort, bool Desc);


        /// <summary>
        /// 文章列表
        /// </summary>
        /// <param name="CateID"></param>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>
        /// <param name="BourseName"></param>
        /// <param name="IsHEadLine"></param>
        /// <param name="HasImg"></param>
        /// <returns></returns>
        [OperationContract]
        List<Article> ArticleList(int CateID, int Page, int PageSize, int CenterID, string Code, bool HasImg, bool Stick, bool IsDel);

         /// <summary>
        /// 百科总数
        /// </summary>
        /// <param name="CateID"></param>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <param name="Title"></param>
        /// <param name="HasImg"></param>
        /// <param name="Stick"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int MArticleCount(int CateID, int CenterID, string Code, string Title, bool HasImg, int Stick, int IsDel);

         /// <summary>
        /// 可以模糊查询百科
        /// </summary>
        /// <param name="Order">默认为创建时间，1-标题，2-点击率3-交易所，4-回复数</param>
        /// <param name="IsStick">0-不置顶，1-置顶，-1代表全部</param>
        /// <param name="IsDel">0-未删除，1-已删除，-1代表全部</param>
        /// <returns></returns>
        [OperationContract]
        List<Article> MArticleList(int CateID, int Page, int PageSize, int CenterID, string Code, string Title, bool HasImg, int Stick, int Order, bool Desc, int IsDel);

          /// <summary>
        /// 手机查询百科
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        List<Article> PArticleList(int CateID, string OpenTime, string EndTime, int PageSize, int CenterID, string Code, string Title, bool HasImg, int Stick, int Order, bool Desc, int IsDel);


        /// <summary>
        /// 文章动作- Filed == "Stick"  || Filed == "IsDel"
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        bool ArticleAction(int ID, string Filed, bool Fn);


        /// <summary>
        /// 新增以及更新文章
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        bool ArticleSet(Article N);

        #endregion

        #region 广告
        /// <summary>
        /// 广告列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="Name"></param>
        /// <param name="Type"></param>
        /// <param name="Img"></param>
        /// <param name="Url"></param>
        /// <param name="Rank"></param>
        /// <param name="Place"></param>
        /// <param name="Dtlimit"></param>
        /// <param name="Order">默认根据rank排序，1-ID，2-开始时间，3-结束时间</param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<WebAd> AdSearch(int PageSize, int Page, string Name, string Type, string Img, string Url, int Rank, string Place, DateTime Dtlimit, int AppOrWeb, int Order, bool Desc, bool IsDel);

        
        /// <summary>
        /// 广告列表-区分是否过期
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="Type"></param>
        /// <param name="Rank"></param>
        /// <param name="Place"></param>
        /// <param name="IsOverdue"></param>
        /// <param name="Order"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<WebAd> AdList(int PageSize, int Page, string Type, int Rank, string Place, int IsOverdue, int AppOrWeb, int Order, bool Desc, bool IsDel);

            /// <summary>
        /// 广告总数-区分是否过期
        /// </summary>
        /// <param name="Type"></param>
        /// <param name="Rank"></param>
        /// <param name="Place"></param>
        /// <param name="IsOverdue"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int AdCount(string Type, int Rank, string Place, string Keys, int IsOverdue, int AppOrWeb, bool IsDel);


          /// <summary>
        /// 广告列表-区分是否过期
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="Type"></param>
        /// <param name="Rank"></param>
        /// <param name="Place"></param>
        /// <param name="IsOverdue"></param>
        /// <param name="Order"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<WebAd> MAdList(int PageSize, int Page, string Type, int Rank, string Place, string Keys, int IsOverdue, int AppOrWeb, int Order, bool Desc, bool IsDel);

             /// <summary>
        /// 删除广告
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int DelAd(int ID);

        /// <summary>
        /// 新增或者修改幻灯片
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        int AddOrUpAd(WebAd model);

        /// <summary>
        /// 根据ID获取幻灯片
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        WebAd AdByID(int ID);
        #endregion

        #region 手机广告
        /// <summary>
        /// 广告列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="Name"></param>
        /// <param name="Type"></param>
        /// <param name="Img"></param>
        /// <param name="Url"></param>       
        /// <param name="Place"></param>      
        /// <param name="Order">默认根据ID排序，1-Place</param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<APPAd> PAdSearch(int PageSize, int Page, string Img, string Type, string Name, string Place, int Order, bool Desc, bool IsDel);

        /// <summary>
        /// 广告总数-区分是否过期
        /// </summary>
        /// <param name="Type"></param>
        /// <param name="Rank"></param>
        /// <param name="Place"></param>
        /// <param name="IsOverdue"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int PAdCount(string Img, string Type, string Name, string Place, bool IsDel);



        /// <summary>
        /// 删除广告
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int PDelAd(int ID);


        /// <summary>
        /// 新增或者修改幻灯片
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        int PAddOrUpAd(APPAd model);

        /// <summary>
        /// 根据ID获取幻灯片
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        APPAd PAdByID(int ID);
        #endregion

        #region 特殊页面
        /// <summary>
        /// 特殊页面列表-区分是否过期
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="Type"></param>
        /// <param name="Rank"></param>
        /// <param name="Place"></param>
        /// <param name="IsOverdue"></param>
        /// <param name="Order"></param>
        /// <param name="Desc"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<SpecialPage> SpecialPageList(int PageSize, int Page, string Name, int Order, bool Desc, bool IsDel);


          /// <summary>
        /// 特殊页面列表-区分是否过期
        /// </summary>
        /// <param name="Type"></param>
        /// <param name="Rank"></param>
        /// <param name="Place"></param>
        /// <param name="IsOverdue"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int SpecialCount(string Name, bool IsDel);


        /// <summary>
        /// 删除特殊页面
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int DelSpecial(int ID);

        /// <summary>
        /// 新增或者修改特殊页面
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        int AddOrUpSpecial(SpecialPage model);

        /// <summary>
        /// 根据ID获取特殊页面
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        SpecialPage SpecialByID(int ID);
        #endregion

        #region 申购日历
          /// <summary>
        /// 申购月份数据
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<Purchase> MPurchaseList(int PageSize, int PageIndex, int CenterID, int Year, int Month, string Cate, int Order, bool Desc);

        /// <summary>
        /// 申购月份数据
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<Purchase> PurchaseList(int PageSize, int PageIndex, int CenterID, int Year, int Month, int Order, bool Desc);

        /// <summary>
        /// 获取申购日历总数
        /// </summary>
        /// <param name="CenterID"></param>
        /// <param name="BeginTime"></param>
        /// <param name="EndTime"></param>
        /// <returns></returns>
        [OperationContract]
        int PurchaseCount(int CenterID, int Year, int Month, string Cate);


        /// <summary>
        /// 申购月份统计
        /// </summary>
        /// <param name="Year"></param>
        /// <param name="Month"></param>
        /// <returns></returns>
        [OperationContract]
        List<PurchaseTotalEntity> PurchaseTotal(int Year, int Month);

       
        /// <summary>
        /// 申购月份数据
        /// </summary>
        /// <param name="Year"></param>
        /// <param name="Month"></param>
        /// <returns></returns>
        [OperationContract]
        List<Purchase> Purchase(int Year, int Month);

         /// <summary>
        /// 申购月份数据[补齐]
        /// </summary>
        /// <param name="Year"></param>
        /// <param name="Month"></param>
        /// <returns></returns>
        [OperationContract]
        List<Purchase> PurchasePolish(int Year, int Month, bool polish);

           /// <summary>
        /// 申购月份数据
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<Purchase> PurchaseNewsTwo(int Year, int Month, string CateName);

        /// <summary>
        /// 可以申购的
        /// </summary>
        /// <param name="Year"></param>
        /// <param name="Month"></param>
        /// <returns></returns>
        [OperationContract]
        List<Purchase> PurchaseNews(string CateName);


        /// <summary>
        /// 申购数据
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        Purchase PurchaseByID(int ID);

        
        /// <summary>
        /// 添加或修改投资日历
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int PurchaseSet(Purchase entity);

        /// <summary>
        /// 删除申购日历
        /// </summary>
        /// <param name="ID">邮吧ID</param>
        /// <param name="Filed">列名</param>
        /// <param name="Fn">值</param>
        /// <returns></returns>
        [OperationContract]
        int PurchaseAction(int ID, string Filed, bool Fn);


        /// <summary>
        /// 改藏品的总申购资金 单签资金 单签持仓
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int PurchaseListed(PurchaseListed entity);


        /// <summary>
        /// 获取藏品的总申购资金 单签资金 单签持仓
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        PurchaseListed PurchaseListedByID(int ID);


           /// <summary>
        /// 手機查詢打新助手
        /// </summary>
        /// <param name="OpenTime"></param>
        /// <returns></returns>
        [OperationContract]
        List<PpurchaseTotalEntity> PPurchaseTotal(DateTime OpenTime);
        #endregion




        #region 新闻专题
        /// <summary>
        /// 新闻专题查询
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        Project ProjectByID(int ID);
        /// <summary>
        /// 新闻列表
        /// </summary>
        /// <param name="PID"></param>
        /// <returns></returns>
        [OperationContract]
        List<News> ProjectNewsByID(int PID);

        
        /// <summary>
        /// 添加专题
        /// </summary>
        /// <param name="Entity"></param>
        /// <returns></returns>
        [OperationContract]
        int AddProject(Project Entity);


        /// <summary>
        /// 专题列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="OrderID"></param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<Project> ProjectList(int PageSize, int PageIndex, int OrderID, bool Desc, bool IsDel);

           /// <summary>
        /// 专题列表-第一个新闻的图片
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="OrderID"></param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<Project> ProjectListImg(int PageSize, int PageIndex, int OrderID, bool Desc, bool IsDel);

        /// <summary>
        /// 专题总数
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int ProjectCount(bool IsDel);

          /// <summary>
        /// 添加或取消新闻
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int PNewsSet(int ID, int PID, int NewID, int Sort);


          /// <summary>
        /// 添加或修改幻灯片
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int PSildeSet(ProjectSilder entity);


          /// <summary>
        /// 根据ID获取专题幻灯片
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        ProjectSilder SildeByID(int ID);


        
        /// <summary>
        /// shanchu 幻灯片
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int DelPSilde(int ID);
           
        
        /// <summary>
        /// 新闻专题查询
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        List<ProjectSilder> ProjectSilder(int ID);


         /// <summary>
        /// 时间戳专题查询
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        List<ProjectTimeEntity> ProjectTimeByPID(int ID);


           /// <summary>
        /// shanchu时间戳
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int DelPTime(int ID);


         /// <summary>
        /// 根据Id获取时间戳
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        ProjectTimeEntity PTimeByID(int ID);


        
        /// <summary>
        /// 添加或修改时间戳
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int PTimeSet(ProjectTimeEntity entity);


        /// <summary>
        /// 删除专题
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int ProjectD(int ID);
        #endregion

    }
}
